<template>
	<view class="news">
		
	  <view v-for="(item,index) in list.records" :key="index" class="newlist">
	  	<dl>
			<dt><img :src="item.pic" alt=""></dt>
			<dd>
				<p>{{item.prodName}}</p>
				<p class='price'>￥{{item.price}}</p>
			</dd>
		</dl>
	  </view>
	  	

	</view>
</template>

<script>
	  export default {
		  data(){
			  return {
				  list:[]
			  }
		  },
		  mounted(){
			  uni.request({
			      url: 'http://111.67.198.176:8112/prod/lastedProdPage', 
			  	method:'GET',
			      data: {
			          text: 'uni.request'
			      },
			  	
			      header: {
			          'custom-header': 'hello' //自定义请求头信息
			      },
			      success: (res) => {
			  		this.list=res.data
			  		console.log(this.list);
			          this.text = 'request success';
			  
			      }
			  });
		  }
	  }
</script>

<style lang="scss">
	.news{
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		.newlist{
			width: 45%;
			height: 280px;
			img{
					width: 100%;
					height: 150px;
				}
				dl{
					width:100%;
				}
		}
	
	}
	
	.price{
		color: red;
	}
</style>